# import pandas as pd
# pd.set_option('display.unicode.east_asian_width',True)
# df=pd.read_excel('超市运营数据.xlsx')
# df['总额']=df['价格']*df['数量']
# df1 = df.groupby('客户类型').agg({'总额':'sum'})
# df1['排名']=df1.rank(method='first',ascending=False)
# df1.sort_values(by='排名',ascending=True,inplace=True)
# print('按客户类型的总额降序排序：\n',df1)
# df2 = df.groupby('销售经理').agg({'总额':'sum'})
# df2['排名']=df2.rank(method='first',ascending=False)
# df2.sort_values(by='排名',ascending=True,inplace=True)
# print('按销售经理的总额降序排序：\n',df2)

#5-1
import matplotlib.pyplot as plt
import pandas as pd
df=pd.read_excel('学生各学期成绩表.xlsx')
x=df['序号']
y=df['语文']
plt.plot(x,y)
plt.figure('学生成绩',(5,4),facecolor='blue')
plt.plot(x,y)
plt.show()

#5-2
import matplotlib.pyplot as plt
import pandas as pd
df=pd.read_excel('学生各学期成绩表.xlsx')
plt.figure(figsize=(12,8))
x=df['序号']
plt.subplot(2,2,1)
plt.plot(x,df['语文'])
plt.subplot(2,2,2)
plt.plot(x,df['数学'])
plt.subplot(2,2,3)
plt.plot(x,df['英语'])
plt.subplot(2,2,4)
plt.plot(x,df['综合'])
plt.show()

#5-3
import matplotlib.pyplot as plt
import pandas as pd
df=pd.read_excel('学生各学期成绩表.xlsx')
fig,axes=plt.subplots(2,2,figsize=(12,8))
ax1=axes[0,0]
ax2=axes[0,1]
ax3=axes[1,0]
ax4=axes[1,1]
x=df['序号']
ax1.plot(x,df['语文'])
ax2.plot(x,df['数学'])
ax3.